<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="zh">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.11.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>cppMISC: wheels::dm::mediator&lt; ITFC_TYPE, Params &gt; 模板类 参考</title>
<link href="../../tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../jquery.js"></script>
<script type="text/javascript" src="../../dynsections.js"></script>
<script type="text/javascript" src="../../clipboard.js"></script>
<link href="../../navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../resize.js"></script>
<script type="text/javascript" src="../../cookie.js"></script>
<link href="../../search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../search/searchdata.js"></script>
<script type="text/javascript" src="../../search/search.js"></script>
<script type="text/javascript" src="../../darkmode_toggle.js"></script>
<link href="../../doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr id="projectrow">
  <td id="projectalign">
   <div id="projectname">cppMISC<span id="projectnumber">&#160;v1.1</span>
   </div>
   <div id="projectbrief">cppMisc 文档系统</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- 制作者 Doxygen 1.11.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
/* @license-end */
</script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() { codefold.init(1); });
/* @license-end */
</script>
<script type="text/javascript" src="../../menudata.js"></script>
<script type="text/javascript" src="../../menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
  initMenu('../../',true,false,'search.php','搜索',false);
  $(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function(){ initResizable(false); });
/* @license-end */
</script>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">载入中...</div>
<div class="SRStatus" id="Searching">搜索中...</div>
<div class="SRStatus" id="NoMatches">未找到</div>
</div>
</div>
</div>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="../../df/d8d/namespacewheels.html">wheels</a></li><li class="navelem"><a class="el" href="../../d8/d2d/namespacewheels_1_1dm.html">dm</a></li><li class="navelem"><a class="el" href="../../d1/dcc/classwheels_1_1dm_1_1mediator.html">mediator</a></li>  </ul>
</div>
</div><!-- top -->
<div id="doc-content">
<div class="header">
  <div class="summary">
<a href="#nested-classes">类</a> &#124;
<a href="#pub-types">Public 类型</a> &#124;
<a href="#pub-methods">Public 成员函数</a> &#124;
<a href="#pro-methods">Protected 成员函数</a> &#124;
<a href="#pro-attribs">Protected 属性</a> &#124;
<a href="../../d1/d46/classwheels_1_1dm_1_1mediator-members.html">所有成员列表</a>  </div>
  <div class="headertitle"><div class="title">wheels::dm::mediator&lt; ITFC_TYPE, Params &gt; 模板类 参考</div></div>
</div><!--header-->
<div class="contents">

<p><code>#include &lt;<a class="el" href="../../db/d94/mediator_8hpp_source.html">mediator.hpp</a>&gt;</code></p>
<div class="dynheader">
wheels::dm::mediator&lt; ITFC_TYPE, Params &gt; 的协作图:</div>
<div class="dyncontent">
<div class="center"><img src="../../dc/dd3/classwheels_1_1dm_1_1mediator__coll__graph.png" border="0" usemap="#awheels_1_1dm_1_1mediator_3_01_i_t_f_c___t_y_p_e_00_01_params_01_4_coll__map" alt="Collaboration graph"/></div>
<map name="awheels_1_1dm_1_1mediator_3_01_i_t_f_c___t_y_p_e_00_01_params_01_4_coll__map" id="awheels_1_1dm_1_1mediator_3_01_i_t_f_c___t_y_p_e_00_01_params_01_4_coll__map">
<area shape="rect" title=" " alt="" coords="5,5,215,523"/>
</map>
</div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="nested-classes" name="nested-classes"></a>
类</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d6/d63/structwheels_1_1dm_1_1mediator_1_1st_msgs.html">stMsgs</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">定义消息结构，消息结构中包含了接收者和消息数据内容  <a href="../../d6/d63/structwheels_1_1dm_1_1mediator_1_1st_msgs.html#details">更多...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pub-types" name="pub-types"></a>
Public 类型</h2></td></tr>
<tr class="memitem:a19f37297c7aceebfc37dea6df052d814" id="r_a19f37297c7aceebfc37dea6df052d814"><td class="memItemLeft" align="right" valign="top">using&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a19f37297c7aceebfc37dea6df052d814">itfc_t</a> = typename std::remove_pointer&lt; typename std::decay&lt;ITFC_TYPE&gt;::type &gt;::type</td></tr>
<tr class="separator:a19f37297c7aceebfc37dea6df052d814"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4358ad34614e37b23e1a129e03b81f89" id="r_a4358ad34614e37b23e1a129e03b81f89"><td class="memItemLeft" align="right" valign="top">using&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a4358ad34614e37b23e1a129e03b81f89">data_t</a> = std::unordered_set&lt; std::shared_ptr&lt; <a class="el" href="#a19f37297c7aceebfc37dea6df052d814">itfc_t</a> &gt; &gt;</td></tr>
<tr class="separator:a4358ad34614e37b23e1a129e03b81f89"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab3d438273c92d65cc530b1071cd81e99" id="r_ab3d438273c92d65cc530b1071cd81e99"><td class="memItemLeft" align="right" valign="top">using&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#ab3d438273c92d65cc530b1071cd81e99">tuple_t</a> = typename std::tuple&lt;Params...&gt;</td></tr>
<tr class="separator:ab3d438273c92d65cc530b1071cd81e99"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pub-methods" name="pub-methods"></a>
Public 成员函数</h2></td></tr>
<tr class="memitem:a2d7ae4ac4b6a19f08bd9f5087cb66968" id="r_a2d7ae4ac4b6a19f08bd9f5087cb66968"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a2d7ae4ac4b6a19f08bd9f5087cb66968">mediator</a> ()</td></tr>
<tr class="separator:a2d7ae4ac4b6a19f08bd9f5087cb66968"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab234b394a7000fe5fba20c05419b2e8c" id="r_ab234b394a7000fe5fba20c05419b2e8c"><td class="memItemLeft" align="right" valign="top">virtual&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#ab234b394a7000fe5fba20c05419b2e8c">~mediator</a> ()</td></tr>
<tr class="separator:ab234b394a7000fe5fba20c05419b2e8c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9aecb8062ad33c4b7a537b0bce646fee" id="r_a9aecb8062ad33c4b7a537b0bce646fee"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a9aecb8062ad33c4b7a537b0bce646fee">add</a> (std::shared_ptr&lt; <a class="el" href="#a19f37297c7aceebfc37dea6df052d814">itfc_t</a> &gt; colleague)</td></tr>
<tr class="memdesc:a9aecb8062ad33c4b7a537b0bce646fee"><td class="mdescLeft">&#160;</td><td class="mdescRight">增加参与者  <br /></td></tr>
<tr class="separator:a9aecb8062ad33c4b7a537b0bce646fee"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a692304c6beb4cdfb126f8382eda448b8" id="r_a692304c6beb4cdfb126f8382eda448b8"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a692304c6beb4cdfb126f8382eda448b8">erase</a> (std::shared_ptr&lt; <a class="el" href="#a19f37297c7aceebfc37dea6df052d814">itfc_t</a> &gt; colleague)</td></tr>
<tr class="memdesc:a692304c6beb4cdfb126f8382eda448b8"><td class="mdescLeft">&#160;</td><td class="mdescRight">删除参与者  <br /></td></tr>
<tr class="separator:a692304c6beb4cdfb126f8382eda448b8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad55a516465f254f306634610538f10d7" id="r_ad55a516465f254f306634610538f10d7"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#ad55a516465f254f306634610538f10d7">run</a> (bool sw)</td></tr>
<tr class="memdesc:ad55a516465f254f306634610538f10d7"><td class="mdescLeft">&#160;</td><td class="mdescRight">启动线程或者关闭线程  <br /></td></tr>
<tr class="separator:ad55a516465f254f306634610538f10d7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9331abcc14e73753ccb6ccd96673df38" id="r_a9331abcc14e73753ccb6ccd96673df38"><td class="memTemplParams" colspan="2">template&lt;typename ... PARAMS&gt; </td></tr>
<tr class="memitem:a9331abcc14e73753ccb6ccd96673df38"><td class="memTemplItemLeft" align="right" valign="top">void&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="#a9331abcc14e73753ccb6ccd96673df38">dispatch</a> (<a class="el" href="#a19f37297c7aceebfc37dea6df052d814">itfc_t</a> *sender, PARAMS &amp;&amp;...args)</td></tr>
<tr class="memdesc:a9331abcc14e73753ccb6ccd96673df38"><td class="mdescLeft">&#160;</td><td class="mdescRight">将消息数据添加到消息队列中，并触发后台线程。通常情况下dispatch函数在colleagueItfc的子类 中的send函数中调用  <br /></td></tr>
<tr class="separator:a9331abcc14e73753ccb6ccd96673df38"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad09a4c9562bfa80883e535a098406dd0" id="r_ad09a4c9562bfa80883e535a098406dd0"><td class="memTemplParams" colspan="2">template&lt;typename ... PARAMS&gt; </td></tr>
<tr class="memitem:ad09a4c9562bfa80883e535a098406dd0"><td class="memTemplItemLeft" align="right" valign="top">void&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="#ad09a4c9562bfa80883e535a098406dd0">dispatchTo</a> (std::shared_ptr&lt; <a class="el" href="#a19f37297c7aceebfc37dea6df052d814">itfc_t</a> &gt; to, PARAMS &amp;&amp;...args)</td></tr>
<tr class="memdesc:ad09a4c9562bfa80883e535a098406dd0"><td class="mdescLeft">&#160;</td><td class="mdescRight">将消息数据添加到消息队列中，并触发后台线程。通常情况下dispatch函数在colleagueItfc的子类 中的send函数中调用  <br /></td></tr>
<tr class="separator:ad09a4c9562bfa80883e535a098406dd0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a16cb0700c56767a896e9426fb612ee95" id="r_a16cb0700c56767a896e9426fb612ee95"><td class="memTemplParams" colspan="2">template&lt;typename ... PARAMS&gt; </td></tr>
<tr class="memitem:a16cb0700c56767a896e9426fb612ee95"><td class="memTemplItemLeft" align="right" valign="top">void&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="#a16cb0700c56767a896e9426fb612ee95">dispatchToDests</a> (std::vector&lt; std::shared_ptr&lt; <a class="el" href="#a19f37297c7aceebfc37dea6df052d814">itfc_t</a> &gt; &gt; dests, PARAMS &amp;&amp;...args)</td></tr>
<tr class="memdesc:a16cb0700c56767a896e9426fb612ee95"><td class="mdescLeft">&#160;</td><td class="mdescRight">将消息数据添加到消息队列中，并触发后台线程。通常情况下dispatch函数在colleagueItfc的子类 中的send函数中调用  <br /></td></tr>
<tr class="separator:a16cb0700c56767a896e9426fb612ee95"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pro-methods" name="pro-methods"></a>
Protected 成员函数</h2></td></tr>
<tr class="memitem:a8a82aa636c133b1f5305434b7edc9eb3" id="r_a8a82aa636c133b1f5305434b7edc9eb3"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a8a82aa636c133b1f5305434b7edc9eb3">backend__</a> ()</td></tr>
<tr class="memdesc:a8a82aa636c133b1f5305434b7edc9eb3"><td class="mdescLeft">&#160;</td><td class="mdescRight">后台处理线程。  <br /></td></tr>
<tr class="separator:a8a82aa636c133b1f5305434b7edc9eb3"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pro-attribs" name="pro-attribs"></a>
Protected 属性</h2></td></tr>
<tr class="memitem:a1feb4f5fe00e8ba052ad19cecea17310" id="r_a1feb4f5fe00e8ba052ad19cecea17310"><td class="memItemLeft" align="right" valign="top"><a class="el" href="#a4358ad34614e37b23e1a129e03b81f89">data_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a1feb4f5fe00e8ba052ad19cecea17310">m_colleague__</a></td></tr>
<tr class="separator:a1feb4f5fe00e8ba052ad19cecea17310"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8df927721cda0bec256c67b99e9018f2" id="r_a8df927721cda0bec256c67b99e9018f2"><td class="memItemLeft" align="right" valign="top">std::queue&lt; <a class="el" href="../../d6/d63/structwheels_1_1dm_1_1mediator_1_1st_msgs.html">stMsgs</a> &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a8df927721cda0bec256c67b99e9018f2">m_msgs__</a></td></tr>
<tr class="separator:a8df927721cda0bec256c67b99e9018f2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a438bbe81ba1bbc618502fe0236d15d3d" id="r_a438bbe81ba1bbc618502fe0236d15d3d"><td class="memItemLeft" align="right" valign="top">std::condition_variable&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a438bbe81ba1bbc618502fe0236d15d3d">m_cnd_var__</a></td></tr>
<tr class="separator:a438bbe81ba1bbc618502fe0236d15d3d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa119454e1321f9b45477a878f87c86df" id="r_aa119454e1321f9b45477a878f87c86df"><td class="memItemLeft" align="right" valign="top">std::atomic&lt; bool &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#aa119454e1321f9b45477a878f87c86df">m_is_running__</a></td></tr>
<tr class="separator:aa119454e1321f9b45477a878f87c86df"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a46bb315e82767596e208d4147834c27b" id="r_a46bb315e82767596e208d4147834c27b"><td class="memItemLeft" align="right" valign="top">std::mutex&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a46bb315e82767596e208d4147834c27b">m_mutex__</a></td></tr>
<tr class="separator:a46bb315e82767596e208d4147834c27b"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">详细描述</h2>
<div class="textblock"><div class="compoundTemplParams">template&lt;typename ITFC_TYPE, typename ... Params&gt;<br />
class wheels::dm::mediator&lt; ITFC_TYPE, Params &gt;</div>
<p class="definition">在文件 <a class="el" href="../../db/d94/mediator_8hpp_source.html">mediator.hpp</a> 第 <a class="el" href="../../db/d94/mediator_8hpp_source.html#l00107">107</a> 行定义.</p>
</div><h2 class="groupheader">成员类型定义说明</h2>
<a id="a4358ad34614e37b23e1a129e03b81f89" name="a4358ad34614e37b23e1a129e03b81f89"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a4358ad34614e37b23e1a129e03b81f89">&#9670;&#160;</a></span>data_t</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename ITFC_TYPE , typename ... Params&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">using <a class="el" href="../../d1/dcc/classwheels_1_1dm_1_1mediator.html">wheels::dm::mediator</a>&lt; ITFC_TYPE, Params &gt;::data_t = std::unordered_set&lt; std::shared_ptr&lt; <a class="el" href="#a19f37297c7aceebfc37dea6df052d814">itfc_t</a> &gt; &gt;</td>
        </tr>
      </table>
</div><div class="memdoc">

<p class="definition">在文件 <a class="el" href="../../db/d94/mediator_8hpp_source.html">mediator.hpp</a> 第 <a class="el" href="../../db/d94/mediator_8hpp_source.html#l00111">111</a> 行定义.</p>

</div>
</div>
<a id="a19f37297c7aceebfc37dea6df052d814" name="a19f37297c7aceebfc37dea6df052d814"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a19f37297c7aceebfc37dea6df052d814">&#9670;&#160;</a></span>itfc_t</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename ITFC_TYPE , typename ... Params&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">using <a class="el" href="../../d1/dcc/classwheels_1_1dm_1_1mediator.html">wheels::dm::mediator</a>&lt; ITFC_TYPE, Params &gt;::itfc_t = typename std::remove_pointer&lt; typename std::decay&lt;ITFC_TYPE&gt;::type &gt;::type</td>
        </tr>
      </table>
</div><div class="memdoc">

<p class="definition">在文件 <a class="el" href="../../db/d94/mediator_8hpp_source.html">mediator.hpp</a> 第 <a class="el" href="../../db/d94/mediator_8hpp_source.html#l00110">110</a> 行定义.</p>

</div>
</div>
<a id="ab3d438273c92d65cc530b1071cd81e99" name="ab3d438273c92d65cc530b1071cd81e99"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab3d438273c92d65cc530b1071cd81e99">&#9670;&#160;</a></span>tuple_t</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename ITFC_TYPE , typename ... Params&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">using <a class="el" href="../../d1/dcc/classwheels_1_1dm_1_1mediator.html">wheels::dm::mediator</a>&lt; ITFC_TYPE, Params &gt;::tuple_t = typename std::tuple&lt;Params...&gt;</td>
        </tr>
      </table>
</div><div class="memdoc">

<p class="definition">在文件 <a class="el" href="../../db/d94/mediator_8hpp_source.html">mediator.hpp</a> 第 <a class="el" href="../../db/d94/mediator_8hpp_source.html#l00113">113</a> 行定义.</p>

</div>
</div>
<h2 class="groupheader">构造及析构函数说明</h2>
<a id="a2d7ae4ac4b6a19f08bd9f5087cb66968" name="a2d7ae4ac4b6a19f08bd9f5087cb66968"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a2d7ae4ac4b6a19f08bd9f5087cb66968">&#9670;&#160;</a></span>mediator()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename ITFC_TYPE , typename ... Params&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="../../d1/dcc/classwheels_1_1dm_1_1mediator.html">wheels::dm::mediator</a>&lt; ITFC_TYPE, Params &gt;::mediator </td>
          <td>(</td>
          <td class="paramname"><span class="paramname"><em></em></span></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p class="definition">在文件 <a class="el" href="../../db/d94/mediator_8hpp_source.html">mediator.hpp</a> 第 <a class="el" href="../../db/d94/mediator_8hpp_source.html#l00149">149</a> 行定义.</p>

</div>
</div>
<a id="ab234b394a7000fe5fba20c05419b2e8c" name="ab234b394a7000fe5fba20c05419b2e8c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab234b394a7000fe5fba20c05419b2e8c">&#9670;&#160;</a></span>~mediator()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename ITFC_TYPE , typename ... Params&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual <a class="el" href="../../d1/dcc/classwheels_1_1dm_1_1mediator.html">wheels::dm::mediator</a>&lt; ITFC_TYPE, Params &gt;::~<a class="el" href="../../d1/dcc/classwheels_1_1dm_1_1mediator.html">mediator</a> </td>
          <td>(</td>
          <td class="paramname"><span class="paramname"><em></em></span></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p class="definition">在文件 <a class="el" href="../../db/d94/mediator_8hpp_source.html">mediator.hpp</a> 第 <a class="el" href="../../db/d94/mediator_8hpp_source.html#l00150">150</a> 行定义.</p>

</div>
</div>
<h2 class="groupheader">成员函数说明</h2>
<a id="a9aecb8062ad33c4b7a537b0bce646fee" name="a9aecb8062ad33c4b7a537b0bce646fee"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a9aecb8062ad33c4b7a537b0bce646fee">&#9670;&#160;</a></span>add()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename ITFC_TYPE , typename ... Params&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="../../d1/dcc/classwheels_1_1dm_1_1mediator.html">wheels::dm::mediator</a>&lt; ITFC_TYPE, Params &gt;::add </td>
          <td>(</td>
          <td class="paramtype">std::shared_ptr&lt; <a class="el" href="#a19f37297c7aceebfc37dea6df052d814">itfc_t</a> &gt;</td>          <td class="paramname"><span class="paramname"><em>colleague</em></span></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>增加参与者 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">colleague[</td><td>I ]， 参与者对象指针 </td></tr>
  </table>
  </dd>
</dl>

<p class="definition">在文件 <a class="el" href="../../db/d94/mediator_8hpp_source.html">mediator.hpp</a> 第 <a class="el" href="../../db/d94/mediator_8hpp_source.html#l00155">155</a> 行定义.</p>

</div>
</div>
<a id="a8a82aa636c133b1f5305434b7edc9eb3" name="a8a82aa636c133b1f5305434b7edc9eb3"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a8a82aa636c133b1f5305434b7edc9eb3">&#9670;&#160;</a></span>backend__()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename ITFC_TYPE , typename ... Params&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="../../d1/dcc/classwheels_1_1dm_1_1mediator.html">wheels::dm::mediator</a>&lt; ITFC_TYPE, Params &gt;::backend__ </td>
          <td>(</td>
          <td class="paramname"><span class="paramname"><em></em></span></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">protected</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>后台处理线程。 </p>
<p>m_is_running__判断后台线程是否需要继续运行，逐个消息队列中读取数据消息内容，并调用目标的recv函数进行处理。如果消息表中没有 内容则等候消息。</p>

<p class="definition">在文件 <a class="el" href="../../db/d94/mediator_8hpp_source.html">mediator.hpp</a> 第 <a class="el" href="../../db/d94/mediator_8hpp_source.html#l00132">132</a> 行定义.</p>
<div class="dynheader">
这是这个函数的调用关系图:</div>
<div class="dyncontent">
<div class="center"><img src="../../d1/dcc/classwheels_1_1dm_1_1mediator_a8a82aa636c133b1f5305434b7edc9eb3_icgraph.png" border="0" usemap="#ad1/dcc/classwheels_1_1dm_1_1mediator_a8a82aa636c133b1f5305434b7edc9eb3_icgraph" alt=""/></div>
<map name="ad1/dcc/classwheels_1_1dm_1_1mediator_a8a82aa636c133b1f5305434b7edc9eb3_icgraph" id="ad1/dcc/classwheels_1_1dm_1_1mediator_a8a82aa636c133b1f5305434b7edc9eb3_icgraph">
<area shape="rect" title="后台处理线程。" alt="" coords="226,5,372,48"/>
<area shape="rect" href="../../d1/dcc/classwheels_1_1dm_1_1mediator.html#ad55a516465f254f306634610538f10d7" title="启动线程或者关闭线程" alt="" coords="5,13,178,40"/>
<area shape="poly" title=" " alt="" coords="210,29,178,29,178,24,210,24"/>
</map>
</div>

</div>
</div>
<a id="a9331abcc14e73753ccb6ccd96673df38" name="a9331abcc14e73753ccb6ccd96673df38"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a9331abcc14e73753ccb6ccd96673df38">&#9670;&#160;</a></span>dispatch()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename ITFC_TYPE , typename ... Params&gt; </div>
<div class="memtemplate">
template&lt;typename ... PARAMS&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="../../d1/dcc/classwheels_1_1dm_1_1mediator.html">wheels::dm::mediator</a>&lt; ITFC_TYPE, Params &gt;::dispatch </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="#a19f37297c7aceebfc37dea6df052d814">itfc_t</a> *</td>          <td class="paramname"><span class="paramname"><em>sender</em></span>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">PARAMS &amp;&amp;...</td>          <td class="paramname"><span class="paramname"><em>args</em></span>&#160;)</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>将消息数据添加到消息队列中，并触发后台线程。通常情况下dispatch函数在colleagueItfc的子类 中的send函数中调用 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">sender[</td><td>I ]， 发送方 </td></tr>
    <tr><td class="paramname">args[</td><td>I ]， 消息内容 </td></tr>
  </table>
  </dd>
</dl>

<p class="definition">在文件 <a class="el" href="../../db/d94/mediator_8hpp_source.html">mediator.hpp</a> 第 <a class="el" href="../../db/d94/mediator_8hpp_source.html#l00208">208</a> 行定义.</p>

</div>
</div>
<a id="ad09a4c9562bfa80883e535a098406dd0" name="ad09a4c9562bfa80883e535a098406dd0"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ad09a4c9562bfa80883e535a098406dd0">&#9670;&#160;</a></span>dispatchTo()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename ITFC_TYPE , typename ... Params&gt; </div>
<div class="memtemplate">
template&lt;typename ... PARAMS&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="../../d1/dcc/classwheels_1_1dm_1_1mediator.html">wheels::dm::mediator</a>&lt; ITFC_TYPE, Params &gt;::dispatchTo </td>
          <td>(</td>
          <td class="paramtype">std::shared_ptr&lt; <a class="el" href="#a19f37297c7aceebfc37dea6df052d814">itfc_t</a> &gt;</td>          <td class="paramname"><span class="paramname"><em>to</em></span>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">PARAMS &amp;&amp;...</td>          <td class="paramname"><span class="paramname"><em>args</em></span>&#160;)</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>将消息数据添加到消息队列中，并触发后台线程。通常情况下dispatch函数在colleagueItfc的子类 中的send函数中调用 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">to[</td><td>I ]， 接收者 </td></tr>
    <tr><td class="paramname">args[</td><td>I ]， 消息内容 </td></tr>
  </table>
  </dd>
</dl>

<p class="definition">在文件 <a class="el" href="../../db/d94/mediator_8hpp_source.html">mediator.hpp</a> 第 <a class="el" href="../../db/d94/mediator_8hpp_source.html#l00230">230</a> 行定义.</p>

</div>
</div>
<a id="a16cb0700c56767a896e9426fb612ee95" name="a16cb0700c56767a896e9426fb612ee95"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a16cb0700c56767a896e9426fb612ee95">&#9670;&#160;</a></span>dispatchToDests()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename ITFC_TYPE , typename ... Params&gt; </div>
<div class="memtemplate">
template&lt;typename ... PARAMS&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="../../d1/dcc/classwheels_1_1dm_1_1mediator.html">wheels::dm::mediator</a>&lt; ITFC_TYPE, Params &gt;::dispatchToDests </td>
          <td>(</td>
          <td class="paramtype">std::vector&lt; std::shared_ptr&lt; <a class="el" href="#a19f37297c7aceebfc37dea6df052d814">itfc_t</a> &gt; &gt;</td>          <td class="paramname"><span class="paramname"><em>dests</em></span>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">PARAMS &amp;&amp;...</td>          <td class="paramname"><span class="paramname"><em>args</em></span>&#160;)</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>将消息数据添加到消息队列中，并触发后台线程。通常情况下dispatch函数在colleagueItfc的子类 中的send函数中调用 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">dests[</td><td>I ]， 接收者数组 </td></tr>
    <tr><td class="paramname">args[</td><td>I ]， 消息内容 </td></tr>
  </table>
  </dd>
</dl>

<p class="definition">在文件 <a class="el" href="../../db/d94/mediator_8hpp_source.html">mediator.hpp</a> 第 <a class="el" href="../../db/d94/mediator_8hpp_source.html#l00252">252</a> 行定义.</p>

</div>
</div>
<a id="a692304c6beb4cdfb126f8382eda448b8" name="a692304c6beb4cdfb126f8382eda448b8"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a692304c6beb4cdfb126f8382eda448b8">&#9670;&#160;</a></span>erase()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename ITFC_TYPE , typename ... Params&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="../../d1/dcc/classwheels_1_1dm_1_1mediator.html">wheels::dm::mediator</a>&lt; ITFC_TYPE, Params &gt;::erase </td>
          <td>(</td>
          <td class="paramtype">std::shared_ptr&lt; <a class="el" href="#a19f37297c7aceebfc37dea6df052d814">itfc_t</a> &gt;</td>          <td class="paramname"><span class="paramname"><em>colleague</em></span></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>删除参与者 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">colleague[</td><td>I ]， 参与者对象指针 </td></tr>
  </table>
  </dd>
</dl>

<p class="definition">在文件 <a class="el" href="../../db/d94/mediator_8hpp_source.html">mediator.hpp</a> 第 <a class="el" href="../../db/d94/mediator_8hpp_source.html#l00165">165</a> 行定义.</p>

</div>
</div>
<a id="ad55a516465f254f306634610538f10d7" name="ad55a516465f254f306634610538f10d7"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ad55a516465f254f306634610538f10d7">&#9670;&#160;</a></span>run()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename ITFC_TYPE , typename ... Params&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">bool <a class="el" href="../../d1/dcc/classwheels_1_1dm_1_1mediator.html">wheels::dm::mediator</a>&lt; ITFC_TYPE, Params &gt;::run </td>
          <td>(</td>
          <td class="paramtype">bool</td>          <td class="paramname"><span class="paramname"><em>sw</em></span></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>启动线程或者关闭线程 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">sw[</td><td>I ] </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>成功操作返回true </dd></dl>

<p class="definition">在文件 <a class="el" href="../../db/d94/mediator_8hpp_source.html">mediator.hpp</a> 第 <a class="el" href="../../db/d94/mediator_8hpp_source.html#l00181">181</a> 行定义.</p>
<div class="dynheader">
函数调用图:</div>
<div class="dyncontent">
<div class="center"><img src="../../d1/dcc/classwheels_1_1dm_1_1mediator_ad55a516465f254f306634610538f10d7_cgraph.png" border="0" usemap="#ad1/dcc/classwheels_1_1dm_1_1mediator_ad55a516465f254f306634610538f10d7_cgraph" alt=""/></div>
<map name="ad1/dcc/classwheels_1_1dm_1_1mediator_ad55a516465f254f306634610538f10d7_cgraph" id="ad1/dcc/classwheels_1_1dm_1_1mediator_ad55a516465f254f306634610538f10d7_cgraph">
<area shape="rect" title="启动线程或者关闭线程" alt="" coords="5,13,178,40"/>
<area shape="rect" href="../../d1/dcc/classwheels_1_1dm_1_1mediator.html#a8a82aa636c133b1f5305434b7edc9eb3" title="后台处理线程。" alt="" coords="226,5,372,48"/>
<area shape="poly" title=" " alt="" coords="178,24,210,24,210,29,178,29"/>
</map>
</div>

</div>
</div>
<h2 class="groupheader">类成员变量说明</h2>
<a id="a438bbe81ba1bbc618502fe0236d15d3d" name="a438bbe81ba1bbc618502fe0236d15d3d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a438bbe81ba1bbc618502fe0236d15d3d">&#9670;&#160;</a></span>m_cnd_var__</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename ITFC_TYPE , typename ... Params&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">std::condition_variable <a class="el" href="../../d1/dcc/classwheels_1_1dm_1_1mediator.html">wheels::dm::mediator</a>&lt; ITFC_TYPE, Params &gt;::m_cnd_var__</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p class="definition">在文件 <a class="el" href="../../db/d94/mediator_8hpp_source.html">mediator.hpp</a> 第 <a class="el" href="../../db/d94/mediator_8hpp_source.html#l00125">125</a> 行定义.</p>

</div>
</div>
<a id="a1feb4f5fe00e8ba052ad19cecea17310" name="a1feb4f5fe00e8ba052ad19cecea17310"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a1feb4f5fe00e8ba052ad19cecea17310">&#9670;&#160;</a></span>m_colleague__</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename ITFC_TYPE , typename ... Params&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="#a4358ad34614e37b23e1a129e03b81f89">data_t</a> <a class="el" href="../../d1/dcc/classwheels_1_1dm_1_1mediator.html">wheels::dm::mediator</a>&lt; ITFC_TYPE, Params &gt;::m_colleague__</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p class="definition">在文件 <a class="el" href="../../db/d94/mediator_8hpp_source.html">mediator.hpp</a> 第 <a class="el" href="../../db/d94/mediator_8hpp_source.html#l00121">121</a> 行定义.</p>

</div>
</div>
<a id="aa119454e1321f9b45477a878f87c86df" name="aa119454e1321f9b45477a878f87c86df"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa119454e1321f9b45477a878f87c86df">&#9670;&#160;</a></span>m_is_running__</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename ITFC_TYPE , typename ... Params&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">std::atomic&lt; bool &gt; <a class="el" href="../../d1/dcc/classwheels_1_1dm_1_1mediator.html">wheels::dm::mediator</a>&lt; ITFC_TYPE, Params &gt;::m_is_running__</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p class="definition">在文件 <a class="el" href="../../db/d94/mediator_8hpp_source.html">mediator.hpp</a> 第 <a class="el" href="../../db/d94/mediator_8hpp_source.html#l00126">126</a> 行定义.</p>

</div>
</div>
<a id="a8df927721cda0bec256c67b99e9018f2" name="a8df927721cda0bec256c67b99e9018f2"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a8df927721cda0bec256c67b99e9018f2">&#9670;&#160;</a></span>m_msgs__</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename ITFC_TYPE , typename ... Params&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">std::queue&lt; <a class="el" href="../../d6/d63/structwheels_1_1dm_1_1mediator_1_1st_msgs.html">stMsgs</a> &gt; <a class="el" href="../../d1/dcc/classwheels_1_1dm_1_1mediator.html">wheels::dm::mediator</a>&lt; ITFC_TYPE, Params &gt;::m_msgs__</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p class="definition">在文件 <a class="el" href="../../db/d94/mediator_8hpp_source.html">mediator.hpp</a> 第 <a class="el" href="../../db/d94/mediator_8hpp_source.html#l00124">124</a> 行定义.</p>

</div>
</div>
<a id="a46bb315e82767596e208d4147834c27b" name="a46bb315e82767596e208d4147834c27b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a46bb315e82767596e208d4147834c27b">&#9670;&#160;</a></span>m_mutex__</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename ITFC_TYPE , typename ... Params&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">std::mutex <a class="el" href="../../d1/dcc/classwheels_1_1dm_1_1mediator.html">wheels::dm::mediator</a>&lt; ITFC_TYPE, Params &gt;::m_mutex__</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p class="definition">在文件 <a class="el" href="../../db/d94/mediator_8hpp_source.html">mediator.hpp</a> 第 <a class="el" href="../../db/d94/mediator_8hpp_source.html#l00127">127</a> 行定义.</p>

</div>
</div>
<hr/>该类的文档由以下文件生成:<ul>
<li>include/designM/<a class="el" href="../../db/d94/mediator_8hpp_source.html">mediator.hpp</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
制作者&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.11.0
</small></address>
</div><!-- doc-content -->
</body>
</html>
